<template>
	<view class="page" style="position: relative;">
		<view class="my-top"
			:style="   'background: url('+OSS_HOST+'img/my_background.png); background-size: cover;'    ">
			<!-- head -->
			<!-- <view class="head" :style="'background-color: rgba(255,255,255,'+(scrollTop/50)+');'">
				<view class="portrait">
					<image v-show="scrollTop>20" src="//img11.360buyimg.com/jdphoto/s40x40_jfs/t1/25255/18/10701/1678/5c89f892E78c04688/684d63c0d68e39b1.png"></image>
				</view>
				<view class="title">
					<text v-show="scrollTop>20">我的</text>
				</view>
				<view class="setting-mess">
					<view class="setting" @click="onSetting">
						<text class="iconfont icon-setting" :style="scrollTop>20?'color:#333333':''"></text>
					</view>
					<view class="mess" @click="onMessage">
						<text class="iconfont icon-xiaoxi" :style="scrollTop>20?'color:#333333':''"></text>
					</view>
				</view>
			</view> -->

			<!-- 用户信息 -->
			<view class="user-info">
				<view class="portrait" @click="onSetting">
					<image :src="data.userInfo.avatar" v-if='data.userInfo.avatar'></image>
					<image :src="OSS_HOST+'img/demo-head.png'" v-else></image>
				</view>
				<view class="info">
					<view class="nickname">
						<text>{{data.userInfo.nickname||'点击头像授权'}}</text>
					</view>
					<view class="nickname">
						<view>{{data.userInfo.mobile}}</view>
						<!-- <image  :src="OSS_HOST +'img/rank.png'"></image>
						<text>v1</text> -->
					</view>
				</view>
				<view class="intave" v-if="data.userInfo.is_staff">
					<view>
						<view>邀请码：</view>
						<view>{{data.userInfo.invite_code||'--'}}</view>
					</view>
				</view>
			</view>
			<!--  <view class="user-info" @click="onUserInfo">
        <view class="portrait">
          <image src="http://img2.imgtn.bdimg.com/it/u=1039075865,3371165857&fm=26&gp=0.jpg"></image>
        </view>
        <view class="info">
          <view class="nickname">
            <text>登录/注册</text>
          </view>
        </view>
      </view> -->
			<!-- 	<view class="vip-qy" @click="onWallet('kaifa')">
	  	<image  :src="OSS_HOST +'img/vip-qy.png'"></image>
	  </view> -->
			<!-- 钱包 -->
			<!-- <view class="wallet-info"> -->
			<!-- <view class="list" >
	  		<view class="icon">
	  			<text class="number">{{data.userInfo.award||0}}</text>
	  		</view>
	  		<view class="title">
	  			<text>积分</text>
	  		</view>
	  	</view>
	  	<view class="list" @click="onWallet('coupon')">
	  		<view class="icon">
	  			<text class="number">0</text>
	  		</view>
	  		<view class="title">
	  			<text>优惠券</text>
	  		</view>
	  	</view>
	  	<view class="list" >
	  		<view class="icon">
	  			<text class="number">0.00</text>
	  		</view>
	  		<view class="title">
	  			<text>钱包</text>
	  		</view>
	  	</view>
		-->
			<!-- 	<view class="list" @tap.stop="tixian()">
	  		<view class="icon">
				<text class="number">佣金:{{data.userInfo.award}}元</text>
	  			
	  		</view>
	  		<view class="title">
	  			<text class="action">提现</text>
	  		</view>
	  	</view> -->

			<!-- <view class="list">
			<view class="icon">
				<text class="number">{{data.userInfo.frozen_award}}元</text>
				<text class="iconfont icon-qianbao"></text>
			</view>
			<view class="title">
				<text class="action">冻结资金</text>
			</view>
		</view> -->
			<!-- </view> -->

			<!-- 关注区 -->
			<!-- <view class="focus-area">
				<view class="list" @click="onCollect('goods')">
					<view class="num">
						<text>0</text>
					</view>
					<view class="title">
						<text>商品关注</text>
					</view>
				</view>
				<view class="list" @click="onCollect('content')">
					<view class="num">
						<text>0</text>
					</view>
					<view class="title">
						<text>喜欢的内容</text>
					</view>
				</view>
				<view class="list" @click="onCollect('record')">
					<view class="num">
						<text>0</text>
					</view>
					<view class="title">
						<text>浏览记录</text>
					</view>
				</view>
			</view> -->
			<!-- 会员 -->
			<!-- <view class="vip-info" @click="onMmeberVip">
				<view class="vip">
					<text>超级会员</text>
					<text class="line"></text>
				</view>
				<view class="vip-explain">
					<text>超级会员一年预计可省99元</text>
				</view>
				<view class="vip-btn">
					<text>立即查看</text>
				</view>
			</view> -->
		</view>

		<!-- 钱包 -->
		<view class="qi-box">
			<view class="txts" @click="onSkipOrder(0)">
				<view class="img">				
					<image :src="OSS_HOST +'img/my_order.png'" mode="widthFix"></image>				
				</view>
				<view class="txtsbutton">
					订单
				</view>
			</view>
			<view class="txts" @click="onWallet('coupon')">
				<view class="img">
					<image :src="OSS_HOST +'img/my_coupon.png'" mode="widthFix"></image>
				</view>
				<view class="txtsbutton">
					优惠券
				</view>
			</view>
			<view class="txts" @click="onWallet('wallet')">
				<view class="img">
					<image :src="OSS_HOST +'img/my_wallet.png'" mode="widthFix"></image>
				</view>
				<view class="txtsbutton">
					我的钱包
				</view>
			</view>
			<view class="txts" @click="onServer('collection')">
				<view class="img">
					<image :src="OSS_HOST +'img/my_collection.png'" mode="widthFix"></image>
				</view>
				<view class="txtsbutton">
					我的收藏
				</view>
			</view>
		</view>

		<!-- 订单信息 -->
		<!-- <view class="order-box">

			<view class="order-text">
				<view class="order-my">
					我的订单
				</view>
				<view class="order-all" @click="onSkipOrder(0)">
					全部订单>
				</view>
			</view>
			<view class="order-info">
				<view class="list" @click="onSkipOrder(1)">
					<view class="img-box">
						<image :src="OSS_HOST +'img/my_pendingPayment.png'" mode="aspectFit"></image>
					</view>
					<view class="title">
						<text>待付款</text>
					</view>
				</view>
				<view class="list" @click="onSkipOrder(2)">
					<view class="img-box">
						<image :src="OSS_HOST +'img/my_mailing.png'" mode="aspectFit"></image>
					</view>
					<view class="title">
						<text>待发货</text>
					</view>
				</view>
				<view class="list" @click="onSkipOrder(3)">
					<view class="img-box">
						<image :src="OSS_HOST +'img/my_transporting.png'" mode="aspectFit"></image>
					</view>
					<view class="title">
						<text>待收货</text>
					</view>
				</view>
				
				<view class="list" @click="onSkipOrder(0)">
					<view class="img-box">
						<image :src="OSS_HOST +'img/my_afterSalesservice.png'" mode="aspectFit"></image>
					</view>
					<view class="title">
						<text>退换</text>
					</view>
				</view>
			</view>
		</view> -->




		<!-- 积分，付款码 -->
		<view class="my-service">
			<view class="service-list">
				<!-- <view class="yaoqing-box log" @tap="onServer('invite_business')">
					<view class="img-box">
						<image :src="OSS_HOST +'img/my_settleIn.png'" mode="aspectFit"></image>
					</view>
					<view>申请注册</view>
				</view> -->
				<view class="list" @click="onServer('auth_business')" v-if="data.userInfo.is_staff">
					<view class="thumb">
						<image :src="OSS_HOST +'img/my_vip_reg.png'" mode="widthFix" style="width: 70rpx;"></image>
				
					</view>
					<view class="name">
						<text>注册审核</text>
					</view>
				</view>
				<view class="list" @click="onServer('Agent_index')"  v-if="data.userInfo.is_staff">
					<view class="thumb">
						<image :src="OSS_HOST +'img/my_user_list.png'" mode="widthFix" style="width: 70rpx;"></image>
					</view>
					<view class="name">用户管理</view>
				</view>
				<view class="list"  @click="onServer('serve')">
					<view class="thumb">
						<image :src="OSS_HOST +'img/my_kefu.png'" mode="widthFix" style="width: 70rpx;"></image>
					</view>
					<view class="name">客服</view>
				</view>
				<view class="list" @click="onSetting">
					<view class="thumb">
						<image :src="OSS_HOST +'img/my_setting.png'" mode="widthFix" style="width: 70rpx;"></image>
					</view>
					<view class="name">
						<text>其他设置</text>
					</view>
				</view>
				<!-- <image  :src="OSS_HOST +'img/shop-activitys.png'"></image> -->
				<!-- <view class="yaoqing-box" @tap="invite('user')">
					<view class="img-box">
						<image :src="OSS_HOST +'img/my_Invite.png'" mode="aspectFit"></image>
					</view>

					
					<view>邀请有礼</view>
				</view>
				<view class="yaoqing-box log" @tap="invite('log')">
					<view class="img-box">
						<image :src="OSS_HOST +'img/my_takeNotes.png'" mode="aspectFit"></image>
					</view>
					<view>邀请记录</view>
				</view> -->
				<!-- <view class="yaoqing-box log"  @click="onServer('Purchaseofgoods')">
					<view class="img-box">
						<image :src="OSS_HOST +'img/my_uploadRequet.png'" mode="aspectFit"></image>
					</view>
					<view>商品求购</view>
				</view> -->
				
				
			</view>
			<!-- 		<view class="list">
				<image :src="OSS_HOST +'img/shop-kanjia.png'"></image>
				<view class="title">
					<text class="iconfont icon-fukuanma"></text>
					<text>付款码</text>
				</view>
				<view class="mess">
					<text>到店扫码 快捷支付</text>
				</view>
			</view> -->
		</view>
		<!-- 我的服务 -->
		<view class="my-service">
			<!-- <view class="title">
				<text>我的服务</text>
			</view> -->
			<view class="service-list">
				<!-- <view class="list" @click="toCompanyDetail()">
					<view class="thumb">
						<text class="iconfont ">&#xe67c;</text>

					</view>
					<view class="name">
						<text>企业介绍</text>
					</view>
				</view> -->
				
				<!-- <view class="list" @click="onServer('serve')">
					<view class="thumb">
						<text class="iconfont ">&#xe67a;</text>

					</view>
					<view class="name">
						<text>联系客服</text>
					</view>
				</view> -->
				<!-- v-if="data.userInfo.is_staff" -->
				

				<!-- v-if="data.userInfo.is_staff" -->

				<!-- <view class="list" @click="onServer('select')" v-if="data.userInfo.is_agent">
					<view class="thumb">
						<text class="iconfont ">&#xe67b;</text>

					</view>
					<view class="name">
						<text>注册查询</text>
					</view>
				</view> -->
				<!-- 			<view class="list" @click="onServer('feedback')">
					<view class="thumb">
						<text class="iconfont ">&#xe618;</text>
						<image :src="OSS_HOST +'img/yjfk.png'"></image>
					</view>
					<view class="name">
						<text>反馈</text>
					</view>
				</view> -->
				<!-- @click="onServer('serve')" -->
				<!-- <view class="list">
					<view class="thumb">
						<button open-type="contact" plain="true"   style="  border-style:none; line-height: 40rpx;   padding: 0;  display: block;font-size: 28rpx;width: 56rpx;">
							<text class="iconfont " >&#xe619;</text>
						</button>
						
					</view>
					<view class="name">
						<button open-type="contact" plain="true"   style="  border-style:none;    padding: 0;  display: block;font-size: 28rpx;">在线客服</button>
					
					</view>
				</view> -->

				<!-- 
				<view class="list" @click="onWallet('coupon')">
					<view class="thumb">
						<text class="iconfont ">&#xe645;</text>
						<image :src="OSS_HOST +'img/yjfk.png'"></image>
					</view>
					<view class="name">
						<text>优惠券</text>
					</view>
				</view> -->

				<!-- <view class="list" @click="onServer('znyx')">
					<view class="thumb">
						<text class="iconfont ">&#xe62d;</text>
						
					</view>
					<view class="name">
						<text>智能医械</text>
					</view>
				</view> -->
				<!-- <view class="list" @click="onServer('batch')"  v-if="data.userInfo.buyer"> 
			
					<view class="thumb">
						<text class="iconfont ">&#xe63a;</text>
						
					</view>
					<view class="name">
						<text>采购</text>
					</view>
				</view> -->
				<!-- 		<view class="list" @click="onServer('invite_business')">
					<view class="thumb">
						<text class="iconfont ">&#xe63d;</text>

					</view>
					<view class="name">
						<text>申请入驻</text>
					</view>
				</view> -->

				<!-- v-if="data.userInfo.is_staff" -->
				<!-- <view class="list" @click="onServer('tuiguan')">
					<view class="thumb">
						<text class="iconfont ">&#xe675;</text>

					</view>
					<view class="name">
						<text>推广管理</text>
					</view>
				</view> -->
			<!-- 	<view class="list" @click="onServer('Agent_index')">
					<view class="thumb">
						<text class="iconfont ">&#xe679;</text>

					</view>
					<view class="name">
						<text>代理商</text>
					</view>
				</view> -->
				<!-- 				<view class="list" @click="onServer('collection')">
					<view class="thumb">
						<text class="iconfont ">&#xe66f;</text>

					</view>
					<view class="name">
						<text>我的收藏</text>
					</view>
				</view> -->

				<!-- <view class="list" @click="toCompanyCert()">
					<view class="thumb">
						<text class="iconfont ">&#xe674;</text>

					</view>
					<view class="name">
						<text>公司资质</text>
					</view>
				</view> -->



				
				<!-- <view class="list" @click="camera()" v-if="data.userInfo.is_staff">
					<view class="thumb">
						<text class="iconfont ">&#xe677;</text>

					</view>
					<view class="name">
						<text>核销商品</text>
					</view>
				</view> -->
			</view>


		</view>
		<view class="vip-banner">
			<image class="img" :src="OSS_HOST +'img/my_vip.png'" ></image>
		</view>
		<!-- 	<view class="my-service">
			<view style="padding: 20rpx;">
				<button open-type="contact"  style="    display: ;font-size: 28rpx;">客服热线</button>
			</view>
			
		</view> -->


		<!-- 客服热线 -->
		<view class="serve-hotline" @click="isHotline = false">
			<view class="cu-modal bottom-modal" :class="{'show':isHotline}">
				<view class="cu-dialog">
					<view class="contact-list">
						<view class="list">
							<text>呼叫客服</text>
						</view>
						<view class="list">
							<text style="color: #959595;" @tap="callTel">0771-5598577</text>
						</view>
						<view class="">
							<button open-type="contact" plain="true"
								style="  border-style:none;    padding: 0;  display: block;font-size: 28rpx;">在线客服</button>

						</view>
						<view class="list">
							<text>取消</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 提现 -->
		<uni-popup ref="getAmount" type="center" custom="true">
			<view class="check-box">
				<view class="content">
					确认提取佣金！
				</view>
				<view class="user-temp">
					<view class="temp-box">
						<view class="temp-left">收款方式：</view>
						<view class="temp-input">
							<view v-for="item in typeList" @tap="checkType(item.type)" class="checkType">
								<text class="iconfont"
									:style="payType==item.type?'color:#ff1717':''">{{payType==item.type?'&#xe60a;':'&#xe638;' }}</text>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
					<view class="temp-box">
						<view class="temp-left">
							收款账号：
						</view>
						<view class="temp-input">
							<Input type="text" v-model="account" placeholder="请输入收款账号"></Input>

						</view>
					</view>
					<view class="temp-box">
						<view class="temp-left">
							联系电话：
						</view>
						<view class="temp-input">
							<Input type="text" v-model="mobile" placeholder="请输入紧急联系电话"></Input>
						</view>
					</view>
				</view>

				<view class="btn-box">
					<view class="btn-close btn-size" @tap="$refs.getAmount.close()">取消</view>
					<view class="btn-qr btn-size" @tap="submitAward">确认</view>
				</view>
			</view>
		</uni-popup>
		<uni-popup ref="checkOrders" type="center" custom="true">
			<view class="check-box">
				<view class="content">
					自提核销
				</view>
				<view class="hexiao">
					<scroll-view scroll-y="true" style="height: 500rpx;" :scroll-top="scroll_header">
						<view class="check-order-box" v-for="item in orderList">
							<view class="product-img">
								<image :src="item.cover_image" style="width: 100rpx; height: 100rpx;"></image>

							</view>
							<view class="product">
								<view>
									订单状态:{{item.related_name}}
								</view>
								<view>{{item.order_estate_name}}</view>
								<view class="justify-between">
									<view>规格:{{item.item_name||'默认'}}</view>
									<view>
										数量：{{item.related_num}}
									</view>
								</view>
								<view>
									<view class="btn-qr onlyone btn-size" @tap="checkOrderId(item.id)">确认核销</view>
								</view>

							</view>


						</view>
					</scroll-view>
				</view>


				<view>自提门店：{{storeName}}</view>
				<view class="btn-box">
					<view class="btn-close btn-size" @tap="$refs.checkOrders.close()">取消</view>
					<view class="btn-qr btn-size" @tap="checkOrder()">全部确认</view>
				</view>
			</view>
		</uni-popup>
		<!-- tabbar -->
		<TabBar :tabBarShow="3" :pageBottom="pageBottom"></TabBar>
		<!-- 登录弹框 -->
		<uni-popup-vlogin id="popupvLogin" ref="popupvLogin" type="bottom" />
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex';
	import TabBar from '../../components/TabBar/TabBar.vue';
	import uniPopup from '@/components/uni-popup/uni-popup.vue'
	import store from '@/store/index.js';
	import {
		oss_host
	} from '@/config/config.js';
	export default {
		components: {
			TabBar,
			uniPopup,
		},
		computed: {
			//注册网络状态
			...mapGetters(['netWorkType', 'loginStatus'])
		},
		data() {
			return {
				scrollTop: 0,
				isHotline: false,
				OSS_HOST: oss_host,
				goodsList: [

				],
				orderList: [],
				storeName: '',
				data: {
					userInfo: [],
					cert: [],
				},
				scroll_header: 0,
				typeList: [{
						type: 1,
						name: '支付宝',
					},
					// {
					// 	type:2,
					// 	name:'微信',
					// }

				],



				payType: '1',
				account: '', //账号
				mobile: '', //
				trade_no: '', //店员 自提核销  付款好
				order_id: '',
				pageBottom: '',
			};
		},
		onReady() {
			uni.hideTabBar();
		},
		onLoad: function(e) {
			let that = this
			uni.getSystemInfo({
				success: function(res) {
					// console.log(res,'手机信息')
					// that.widowWidth = res.widowWidth;2
					// that.windowHeight = res.windowHeight * 2;
					// console.log(that.windowHeight,'****windowHeight*****')
					// that.pageTop =res.safeAreaInsets.top *2; //头部刘海
					that.pageBottom = res.safeAreaInsets.bottom * 2 //底部刘海

				}
			})
			if (this.loginStatus) {
				this.getUserInfo()
			}
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
		},

		methods: {
			/**
			 *  自提核销
			 * 
			 * */
			camera() {
				const _this = this
				console.log(99)
				//授权手机    必须
				//console.log('camera')
				//#ifdef  H5

				jweixin.scanQRCode({
					needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
					scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码，默认二者都有
					success: function(res) {

					}
				});
				//#endif

				//#ifdef  MP-WEIXIN || MP-ALIPAY ||APP-PLUS

				uni.scanCode({
					onlyFromCamera: true,
					success: function(res) {
						console.log(res)
						//console.log('条码类型：' + res.scanType);
						//扫码进入售后商品详情

						if (res.scanType == "QR_CODE") {
							let scene = decodeURIComponent(res.result)
							console.log('*****scene', scene)
							// 获取产品id  用户id
							let trade_no = _this.getQueryVariable('trade_no', scene)
							_this.trade_no = trade_no
							if (trade_no) {
								_this.checkOrderDetail(trade_no)
							}



							//登陆状态才远程访问资源

						}
					}
				});


				//#endif
			},
			//解析url参数
			/*
			 *  variable   参数名
			 *  url        URL
			 */
			getQueryVariable(variable, url) {
				//var url = 'https://api.aiouning.com/wechat/product/param/?sid=12&pid=37&bid=1&cid=2';
				var vars = url.split("param/?");
				// vars[1] = vars[1].replace(/%3D/g, "=").replace(/%26/g, "&")
				// console.log(vars)
				var param = vars[1].split("&");

				for (var i = 0; i < param.length; i++) {
					var pair = param[i].split("=");
					// console.log(pair)
					if (pair[0] == variable) {
						return pair[1];
					}
				}
				return (false);
			},
			callTel() {
				wx.makePhoneCall({
					phoneNumber: '0771-5598577' //仅为示例，并非真实的电话号码
				})
			},
			checkOrderDetail(trade_no) {
				let _this = this
				var opt = {
					url: '/order/checkOrderDetail',
					data: {
						trade_no: trade_no,

					},
					success: function(res) {
						if (res.status == 1) {
							_this.orderList = res.data.list
							_this.storeName = res.data.storeName
							_this.$refs.checkOrders.open()
						} else {
							uni.showToast({
								icon: 'none',
								title: res.message
							})
							//未登陆
							// store.dispatch('changeLogin', false)

						}
					}
				};
				if (_this.loginStatus) {
					_this.$service.GetApi(opt)
				}
			},
			checkOrderId(order_id) {
				this.order_id = order_id
				this.checkOrder()
			},
			toCompanyDetail() {
				uni.openOfficialAccountArticle({
					url: 'https://mp.weixin.qq.com/s/SfXVan1uvlx3fbLxkir_yg', // 此处填写公众号文章连接
					success: (res) => {
						console.log(res, '111111sucess')
					},
					fail: (res) => {
						console.log(res, '2222')
					}
				})
			},
			toCompanyCert() {
				let _this = this

				_this.$refer.setVilit('/pages/CertDetail/index')
				let callback = function(url) {
					// _this.$refs.popupvLogin.open()
				}
				let data = {
					title: '公司资质',
					// list: JSON.stringify(_this.data.cert)
				}
				_this.$refer.toUrl(callback, data)
			},
			checkOrder() {
				let _this = this
				var opt = {
					url: '/order/checkOrderEstate',
					data: {
						trade_no: _this.trade_no,
						id: _this.order_id || ''
					},
					success: function(res) {
						if (res.status == 1) {
							_this.order_id = ''
							uni.showToast({
								icon: 'none',
								title: '核销成功'
							})
							_this.checkOrderDetail(_this.trade_no)
							// _this.
							_this.$refs.checkOrders.close()
						} else {
							uni.showToast({
								icon: 'none',
								title: res.message
							})
							//未登陆
							// store.dispatch('changeLogin', false)

						}
					}
				};
				if (_this.loginStatus) {
					_this.$service.GetApi(opt)
				}
			},

			/**
			 * 关注跳转
			 */
			onCollect(type) {
				// uni.showToast({
				//   title: '开发中，尽情期待！',
				//   icon: 'none'
				// })
				// return ;
				switch (type) {
					case 'goods':
						uni.navigateTo({
							url: '/pages/GoodsOn/GoodsOn'
						})
						break;
					case 'content':
						uni.navigateTo({
							url: '/pages/ContentCollection/ContentCollection'
						})
						break;
					case 'record':
						uni.navigateTo({
							url: '/pages/BrowsingHistory/BrowsingHistory'
						})
						break;
				}
			},
			/**
			 * 订单
			 */
			onSkipOrder(type) {
				if (type === 5) {
					uni.navigateTo({
						url: '/pages/AfterSalesOrder/AfterSalesOrder',
					})
					return;
				}
				let _this = this

				_this.$refer.setVilit('/pages/Order/order_list_center')
				let callback = function(url) {
					_this.$refs.popupvLogin.open()
				}
				let data = {
					currentTab: type

				}
				_this.$refer.toUrl(callback, data)
				// uni.navigateTo({
				// 	// url: '/pages/MyOrderList/MyOrderList?type=' + type,
				// 	url:'/pages/Order/order_list_center'
				// })
			},
			// 会员入口
			toVip() {

				let _this = this
				return;

				_this.$refer.setVilit('/packageBatch/pages/my/card/index')
				let callback = function(url) {
					_this.$refs.popupvLogin.open()
				}
				let data = {
					// currentTab:type

				}
				_this.$refer.toUrl(callback, data)
			},

			/**
			 * 钱包跳转点击
			 */
			onWallet(type) {

				let _this = this
				switch (type) {
					case 'integral':
						uni.navigateTo({
							url: '/pages/IntegralDetails/IntegralDetails',
						})
						break;
					case 'coupon':
						_this.$refer.setVilit('/pages/Coupon/coupon')
						let callback = function(url) {
							_this.$refs.popupvLogin.open()
						}
						let data = {



						}
						_this.$refer.toUrl(callback, data)
						// uni.navigateTo({
						// 	url: '/pages/Coupon/coupon',
						// })
						break;
					case 'wallet':
						// uni.showToast({
						// 	title: '开发中，尽情期待！',
						// 	icon: 'none'
						// })
						_this.$refer.setVilit('/packageUser/pages/my/MyWallet/MyWallet')
						let callback1 = function(url) {
							_this.$refs.popupvLogin.open()
						}
						let data1 = {
						}
						_this.$refer.toUrl(callback1, data1)
						
						break;
					case 'SignIn':
						uni.navigateTo({
							url: '/pages/SignIn/SignIn',
						})
						break;
					case 'payment':
						uni.navigateTo({
							url: '/pages/PaymentCode/PaymentCode',
						})
						break;
					case 'kaifa':
						uni.showToast({
							title: '开发中，尽情期待！',
							icon: 'none'
						})
						break;
					case 'kanjia':
						if (!this.loginStatus) {
							this.$refs.popupvLogin.open()
							return
						}
						uni.navigateTo({
							url: '/pages/Bargain/index',

						})
						break;

				}
			},
			tixian() {
				const _this = this
				if (!_this.loginStatus) {
					_this.$refs.popupvLogin.open()
					return
				}
				// let a =0
				if (_this.data.userInfo.award <= 0) {
					uni.showToast({
						icon: 'none',
						title: '暂无可提现的佣金'
					})
					return
				}
				this.$refs.getAmount.open()

			},
			// 选择提现 收款方式
			checkType(type) {
				this.payType = type
			},
			// 提现
			submitAward() {
				let _this = this
				let data = {
					type: _this.payType,
					account: _this.account,
					mobile: _this.mobile
				}
				var opt = {
					url: '/user/getAward',
					data: data,
					success: function(res) {

						if (res.status == 1) {
							let result = res.data
							_this.getUserInfo()
							uni.showToast({
								icon: 'none',
								title: '提交成功，等待后台审核.'
							})
							_this.$refs.getAmount.close()
							// _this.data.couponList = res.data.couponList 
							// //有优惠券则弹出
							// if(res.data.couponList.length>0){
							// 	_this.$refs.popupGet.open()
							// }
						}
						// _this.skeletonShow = false;
					}
				};


				this.$service.GetApi(opt) //网络


			},
			getUserInfo() {
				const _this = this

				var opt = {
					url: '/user/userInfo',
					data: {

						// adv_channel:this.adv_channel
					},
					success: function(res) {

						if (res.status == 1) {
							let result = res.data
							_this.data.userInfo = result.userInfo
							// if(uni.getStorageSync('isbuyer') == '' ){
							// 	uni.setStorageSync('isbuyer', _this.data.userInfo.is_buyer?true:false);
							// 	store.dispatch('setIsbuyer', _this.data.userInfo.is_buyer?true:false);
							// }
							// if(_this.data.userInfo.buyer || uni.getStorageSync('isbuyer') == ''){
							// 	uni.setStorageSync('isbuyer', _this.data.userInfo.buyer?1:0);
							// 	store.dispatch('setIsbuyer', _this.data.userInfo.buyer?1:0);
							// }

							// console.log(1111,uni.getStorageSync('isBuyer'))
							// _this.data.couponList = res.data.couponList 
							// //有优惠券则弹出
							// if(res.data.couponList.length>0){
							// 	_this.$refs.popupGet.open()
							// }
						}
						// _this.skeletonShow = false;
					}
				};


				this.$service.GetApi(opt) //网络



			},
			/**
			 * 我的服务点击
			 */
			onServer(type) {
				let _this = this
				switch (type) {
					case 'feedback':

						uni.navigateTo({
							url: '/pages/Feedback/Feedback'
						})
						break;
					case 'serve':
						this.isHotline = true;
						break;
					case 'znyx':
						_this.$refer.setVilit('/packageHealthy/pages/main')
						let callback = function(url) {
							_this.$refs.popupvLogin.open()
						}
						let data = {}
						_this.$refer.toUrl(callback, data)

						break;
					case 'batch':
						console.log(111)
						_this.$refer.setVilit('/packageBatch/pages/Batch/Batch')
						let callback1 = function(url) {
							_this.$refs.popupvLogin.open()
						}
						let data1 = {



						}
						_this.$refer.toUrl(callback1, data1)

						break;
					case 'invite_business':
						_this.$refer.setVilit('/packageInvite/pages/businessEnter/business_list')
						let callback2 = function(url) {
							_this.$refs.popupvLogin.open()
						}
						let data2 = {


						}
						_this.$refer.toUrl(callback2, data2)
						break;
					case 'auth_business':
						_this.$refer.setVilit('/packageInvite/pages/businessEnter/list')
						let callback3 = function(url) {
							_this.$refs.popupvLogin.open()
						}
						let data3 = {



						}
						_this.$refer.toUrl(callback3, data3)
						break;
					case 'select':
						_this.$refer.setVilit('/packageInvite/pages/business/list')
						callback = function(url) {
							_this.$refs.popupvLogin.open()
						}
						data = {

						}
						_this.$refer.toUrl(callback, data)
						break;
					case 'tuiguan':
						_this.$refer.setVilit('/packageUser/pages/area/index')
						callback = function(url) {
							_this.$refs.popupvLogin.open()
						}
						data = {

						}
						_this.$refer.toUrl(callback, data)
						break;
					case 'Agent_index':
						_this.$refer.setVilit('/packageAgent/pages/home/AgentHome')
						callback = function(url) {
							_this.$refs.popupvLogin.open()
						}
						data = {

						}
						_this.$refer.toUrl(callback, data)
						break;
					case 'collection':
						_this.$refer.setVilit('/packageAgent/pages/collection/collection')
						callback = function(url) {
							_this.$refs.popupvLogin.open()
						}
						data = {

						}
						_this.$refer.toUrl(callback, data)
						break;
					case 'Purchaseofgoods':
						_this.$refer.setVilit('/packageAgent/pages/Purchaseofgoods/Purchaseofgoods')
						callback = function(url) {
							_this.$refs.popupvLogin.open()
						}
						data = {

						}
						_this.$refer.toUrl(callback, data)
						break;

				}
			},
			// 邀请好友
			invite(type) {
				const _this = this
				switch (type) {
					case 'user':
						// 邀请 生成海报图  1级分销
						_this.$refer.setVilit('/packageUser/pages/my/qrcode/qrcode')
						let callback = function(url) {
							_this.$refs.popupvLogin.open()
						}
						let data = {



						}
						_this.$refer.toUrl(callback, data)
						break;
					case 'log':
						// 邀请记录
						_this.$refer.setVilit('/packageUser/pages/my/log/log')
						let callback1 = function(url) {
							_this.$refs.popupvLogin.open()
						}
						let data1 = {}
						_this.$refer.toUrl(callback1, data1)
						break
				}

			},
			/**
			 * 设置点击
			 */
			onSetting() {
				let _this = this
				_this.$refer.setVilit('/pages/Setting/Setting')
				let callback1 = function(url) {
					_this.$refs.popupvLogin.open()
				}
				let data1 = {



				}
				_this.$refer.toUrl(callback1, data1)

			},
			/**
			 * 消息点击
			 */
			onMessage() {

				uni.navigateTo({
					url: '/pages/Message/Message'
				})
			},
			/**
			 * 会员点击
			 */
			onMmeberVip() {

				uni.navigateTo({
					url: '/pages/MembersOpened/MembersOpened',
				})
			},
			/**
			 * 跳转点击
			 * @param {String} type 跳转类型
			 */
			onSkip(type) {
				switch (type) {
					case 'goods':
						uni.navigateTo({
							url: '/pages/GoodsDetails/GoodsDetails',
							animationType: 'zoom-fade-out',
							animationDuration: 200
						})
						break;
				}
			},
			/**
			 * 用户信息点击
			 * @param {Number} type
			 */
			onUserInfo() {
				uni.navigateTo({
					url: '/pages/login/login'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import 'my.scss';
</style>